package com.my.yyr.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@RestController
public class TestController {

    @GetMapping("/hi")
    public String sayHello() {
        return "大家好！";
    }

    @GetMapping("/hi2")
    public Map<String, Object> sayHello2() {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("stuId", "张三");
        map.put("stuDate", new Date());
        map.put("stuName","小张");
        return map;
    }
}
